//
//  YDFundDetailsModel.m
//  PeiZiWangBei
//
//  Created by LK-IOS on 2017/12/4.
//  Copyright © 2017年 LK-IOS. All rights reserved.
//

#import "YDFundDetailsModel.h"

@implementation YDFundDetailsModel

+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{
             @"Id" : @"id"
             };
}
-(NSString *)year
{
    if (self.occurrenceTime.length) {
        
        NSDateFormatter *formate = [[NSDateFormatter alloc] init];
        [formate setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
        NSDate *date = [formate dateFromString:self.occurrenceTime];
        
        NSDateFormatter *formate1 = [[NSDateFormatter alloc] init];
        [formate1 setDateFormat:@"yyyy.MM.dd"];
        return [formate1 stringFromDate:date];
    }else{
        return @"----";
    }
    

}


-(NSString *)hour
{
    if (self.occurrenceTime.length) {
        NSDateFormatter *formate = [[NSDateFormatter alloc] init];
        [formate setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
        NSDate *date = [formate dateFromString:self.occurrenceTime];
        NSDateFormatter *formate1 = [[NSDateFormatter alloc] init];
        [formate1 setDateFormat:@"HH:mm:ss"];
        
        return [formate1 stringFromDate:date];
    }else{
        return @"----";
    }

}

-(NSString *)fundAccunt
{
    if (self.amount.length) {
        NSString *amountString = [NSString stringWithFormat:@"%@",self.amount];
        if ([amountString floatValue] >= 0) {
            return [NSString stringWithFormat:@"+%@" , [NSString countNumAndChangeformat:amountString]];
        }else{
            return [NSString stringWithFormat:@"-%@" , [NSString  countNumAndChangeformat:[amountString pz_stringNumberByMultiplyingBy:@"-1"]]];
        }
        
    }else{
        return @"----";
        
    }
}

@end
